<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<c:set var="context"
	value="${pageContext.request.servletContext.contextPath}" />
<!-- Template for all sub-pages -->
<div id="portal_main_content" align="left">
	<!-- Don't change this -->
	<div id="site_title">

		<!-- ************** -->
		<!-- Able to change -->
		<h2>Edit User</h2>
	</div>
	<!-- Don't change this -->
	<div id="site_content">
		<div id="btn_control">

			<!-- ************** -->
			<!-- Able to change -->

		</div>
		<div id="main_content">

			<!-- ************** -->
			<!-- Able to change -->
			<form:form action="../edit/${user.userId}" modelAttribute="user"
				method="post" style="min-width: 240px;">
				<fieldset class="input_table">
					<legend>Edit User</legend>
					<div class="input_row hidden" >
						<div>Name</div>
						<div>
							<form:input path="userId" placeholder="Id"
								cssClass="form-control" />
						</div>
						<div class="error"></div>
					</div>
					<div class="input_row">
						<div>Name</div>
						<div>
							<form:input path="name" placeholder="Name"
								cssClass="form-control" />
						</div>
						<div>
							<form:errors path="name" cssClass="error" />
						</div>
					</div>
					<div class="input_row"></div>
					<div class="input_row">
						<div>Email</div>
						<div>
							<form:input path="email" placeholder="Email"
								cssClass="form-control" />
						</div>
						<div>
							<form:errors path="email" cssClass="error" />
						</div>
					</div>
					<div class="input_row"></div>
					<div class="input_row">
						<div>Password</div>
						<div>
							<form:password path="password" placeholder="Password"
								cssClass="form-control" />
						</div>
						<div>
							<form:errors path="password" cssClass="error" />
						</div>
					</div>
					<div class="input_row"></div>
					<div class="input_row">
						<div>Role</div>
						<div>
							<form:input path="role" cssClass="hidden" />
							<c:if test="${user.role == 1}">Moderator</c:if>
							<c:if test="${user.role == 2}">Lecturer</c:if>
							<c:if test="${user.role == 3}">Student</c:if>
						</div>
						<div></div>
					</div>
					<div class="input_row">
						<form:errors path="role" cssClass="error" />
					</div>
					<div class="input_row">
						<div>Active</div>
						<div>
							<form:checkbox path="active" placeholder="isActive"
								cssClass="checkbox" />
						</div>
						<div></div>
					</div>
					<div class="input_row">
						<form:errors path="active" cssClass="error" />
					</div>
					<div class="input_row">
						<div></div>
						<div>
							<input type="submit" value="Save" class="btn btn-primary" /> <a
								href="../" class="btn btn-primary">Cancel</a>
						</div>
						<div></div>
					</div>
				</fieldset>
			</form:form>
		</div>
		<div id="table">

			<!-- ************** -->
			<!-- Able to change -->
		</div>

	</div>
</div>

